package com.jilujia.framework.web;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class PageRedirectController {

	private static final Logger LOG = LoggerFactory.getLogger(PageRedirectController.class);

	@RequestMapping("/login_goto")
	@Secured( { "ROLE_USER" })
	public String handleRequest(@RequestParam String page, HttpServletRequest request, HttpServletResponse response)
			throws Exception {

		LOG.debug("page:" + page);
		return "redirect:" + page;
	}

}
